UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G4gHPKGTYOL05C/i2B9KPGl7Q6no6bE9+WiDhNWrtJw='
WHERE
key_id = '19131637882602b8945afdce0a76d06b09c3132eda461a98cd7c623d360feaf2'
AND (
token = 'G4gHPKGTYOL05C/i2B9KPGl7Q6no6bE9+WiDhNWrtJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)