UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '81U8uRMvnQXtRLgdYcR/+NuEH8XEEVlgEjviO/Xscgc='
WHERE
key_id = '11852beb83765fd5a24b0bb78081cad9ae9a1629b7018b76e0b2585a1fd5a060'
AND (
token = '81U8uRMvnQXtRLgdYcR/+NuEH8XEEVlgEjviO/Xscgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)