UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7sQDZSgqGVW+YYfs8K7JLwMqZZdQqu+2Q32mj5us3tA='
WHERE
key_id = '5299e0a2fdf751b3266ba205d54c7863d63f29359ad994946b84f5eb6c6d1c70'
AND (
token = '7sQDZSgqGVW+YYfs8K7JLwMqZZdQqu+2Q32mj5us3tA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)