UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e2zUe+Itkl0tvDUT0CJprtLJyJuEtuPzWmAF999pJgQ='
WHERE
key_id = 'e724ac43f446ae13cef1f4d534bb7f562661366f6b3e813a5681ebc8dfbbfb29'
AND (
token = 'e2zUe+Itkl0tvDUT0CJprtLJyJuEtuPzWmAF999pJgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)