UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0uyoRB1fEcGT7GRy2AlcrMdjrpeuiQn8i5wf7IkXSPA='
WHERE
key_id = '9a2b70ab0286575ec1353e9176012f4f576628287ab87711045b63836cae2413'
AND (
token = '0uyoRB1fEcGT7GRy2AlcrMdjrpeuiQn8i5wf7IkXSPA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)