UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WvEf7rbgXn/DKeUN+b5frhPK1d52Xbkyt6hlN6kRP6w='
WHERE
key_id = 'dfcea1700c29f435f59c9c62e3923bec130aedf1164b78d78ee5c82cd6d3be9a'
AND (
token = 'WvEf7rbgXn/DKeUN+b5frhPK1d52Xbkyt6hlN6kRP6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)