UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oGOhVGnAhZNK7cm32xYTohol16ShegaPo9oF74GUKt4='
WHERE
key_id = 'eb08be5c1c41b3733edd4057b6c15d63e6d73dc4cd930464801591fe1d116db5'
AND (
token = 'oGOhVGnAhZNK7cm32xYTohol16ShegaPo9oF74GUKt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)