UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ZFBmJdvSpadAwocftSmwnrMwRP5IecJQ/TQ+siPffo='
WHERE
key_id = '953eaa983bdeb53967c2c0b72b9383885aa5524741f123deabdb32118245178c'
AND (
token = '5ZFBmJdvSpadAwocftSmwnrMwRP5IecJQ/TQ+siPffo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)