UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IZ09WbEG9Vapj0U9eYWHJJAEKDKHvNFEOERV0bBBC2E='
WHERE
key_id = '88ad2a0a502bc025ec14019da48b5bd4de2911edfbd609c29a57a5214039c98c'
AND (
token = 'IZ09WbEG9Vapj0U9eYWHJJAEKDKHvNFEOERV0bBBC2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)