UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l8E/nIK5YVhZuEsBBFjv7R5K3XYpp8utJIZa7d/UaRg='
WHERE
key_id = 'c8502f15bf73c8147c0d8cb1df31716c89c354868eb727230d875fa92961df48'
AND (
token = 'l8E/nIK5YVhZuEsBBFjv7R5K3XYpp8utJIZa7d/UaRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)