UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g/xhdgHpT6RlYS3SM5KhoMJzr5nvEsKIreTa7aKO4nE='
WHERE
key_id = '52da9875b981a9c1f5d4c7e1eb19283387a9eda9b89fe75372525d7443f5665e'
AND (
token = 'g/xhdgHpT6RlYS3SM5KhoMJzr5nvEsKIreTa7aKO4nE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)