UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0z1S4qMmHDMOqgm0OgbQMH/Xy9VNhZBbzK9YxGC2Ye4='
WHERE
key_id = '11fdf67019706163bb18c93373b9cd20c44a600f7e5489988aa7f01b9991ff9d'
AND (
token = '0z1S4qMmHDMOqgm0OgbQMH/Xy9VNhZBbzK9YxGC2Ye4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)