UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TRCtug4WUAwEKYFkxsBKbNTTxIaD6DB1FTdX14ZnbSA='
WHERE
key_id = '11aa099b9fdc064125c8b2ac4c195d0c32a0705c9e8e186e9fa46a43427d9747'
AND (
token = 'TRCtug4WUAwEKYFkxsBKbNTTxIaD6DB1FTdX14ZnbSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)