UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WnjaymFaN3iz1bdRa6o8PwaKFVZZ871WAwcdNiZmA8E='
WHERE
key_id = 'ff90c87b11f733861a8f00ee2abbe5df68c8997c9821898e27bad5ac6d19eb3b'
AND (
token = 'WnjaymFaN3iz1bdRa6o8PwaKFVZZ871WAwcdNiZmA8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)