UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y59Big9anR7Gm4Zb/X3DgBjweoFwKdGNEgUGBGhC9Jk='
WHERE
key_id = 'b11f75179c4cd64e83ab6d166734987d4ca7e428244403bbc73c8f0333421fe0'
AND (
token = 'Y59Big9anR7Gm4Zb/X3DgBjweoFwKdGNEgUGBGhC9Jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)