UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cDT082xnxZmlWrxYUHPh0mfgwvQGml5usLu8+id0Ej0='
WHERE
key_id = '4ba705b49eb92705cb4c4b400d4db0e0969a9c640c56111402a041e550d164da'
AND (
token = 'cDT082xnxZmlWrxYUHPh0mfgwvQGml5usLu8+id0Ej0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)