UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l6Mw9McRJXa2lEsMb4haWg3ab+66ydkxEjjtXqKfH9U='
WHERE
key_id = '125c4f8b8777e28cca4840ae819ace4bc893d53e7db8889f3f45574a132db196'
AND (
token = 'l6Mw9McRJXa2lEsMb4haWg3ab+66ydkxEjjtXqKfH9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)