UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xuIYN1Ua+CxibrfNZXprGP4d8FER+i45jmTW8ZRELuU='
WHERE
key_id = '1e9645ebd819416dfce0e4f9de828528d40253c71ce91a63a896ead37a0815ce'
AND (
token = 'xuIYN1Ua+CxibrfNZXprGP4d8FER+i45jmTW8ZRELuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)