UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8SbFnLSahxoeF3LaIVRQX4A2s6h0oNjErTdJYWTC5cM='
WHERE
key_id = '709300e9a6ea374dda5b45201b2ac47017af5f28f7cc18c654937c04c6d375e8'
AND (
token = '8SbFnLSahxoeF3LaIVRQX4A2s6h0oNjErTdJYWTC5cM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)