UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '14JrHKkiLtAMYogEz/1lZO+zWxGDW+zJXQLimw/l03Y='
WHERE
key_id = 'fb84bc3af5beef399440112667d347f970ab5629a331d4739688dac8cc9fddfb'
AND (
token = '14JrHKkiLtAMYogEz/1lZO+zWxGDW+zJXQLimw/l03Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)