UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U+M13JoLpNJzzuCFSbSpX6LHRPB4INwDA9Jm832L52g='
WHERE
key_id = 'f6d11d6853e145f3d17388b7446b80a1ffe69ce841f4fb22677b5bb471d9bdac'
AND (
token = 'U+M13JoLpNJzzuCFSbSpX6LHRPB4INwDA9Jm832L52g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)