UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uYqU4flacibnmOPStgM+MTTTQzfYP+n+2GLD5lF2GIo='
WHERE
key_id = 'f154aa120b6d7493300d9f3dbc1d682689afca3326758f775c0ecdf38f86ddd5'
AND (
token = 'uYqU4flacibnmOPStgM+MTTTQzfYP+n+2GLD5lF2GIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)