UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GhXKEfuvTiU6yK0d2iZ0Txa7NYH2dSS6CNledciibV0='
WHERE
key_id = 'eff14329323384418088f4d1ade37845e010b48f4da6911043175b45202d4257'
AND (
token = 'GhXKEfuvTiU6yK0d2iZ0Txa7NYH2dSS6CNledciibV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)