UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tw+tZLHO3fDbCfODen32PMXoIvsGSaKcuqOEwosv9qI='
WHERE
key_id = '890d09240421171c542768f5555d371dd33893e25a71767bff0fe46622068dd8'
AND (
token = 'Tw+tZLHO3fDbCfODen32PMXoIvsGSaKcuqOEwosv9qI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)