UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '26s8z99bRqSW+rw8ZUhJuIGnyNEraN2Xiakk2xCphJ8='
WHERE
key_id = '7c60de0d803c748b248306d8367fd8926010f8fc980130673e996fa20f19f608'
AND (
token = '26s8z99bRqSW+rw8ZUhJuIGnyNEraN2Xiakk2xCphJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)