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