UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bi4mMfs19DUkypmb6YNyfUaw5zG2W2MgzHCQZLOnee4='
WHERE
key_id = '2f29b473cf265adacbef615b25e4bbfc11aa31f49a8fafbf38b673ea058a6809'
AND (
token = 'bi4mMfs19DUkypmb6YNyfUaw5zG2W2MgzHCQZLOnee4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)