UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GnOq1bgHGBlIkJo9TFyCrhel2m4rOQZPgOEVQCvV3+A='
WHERE
key_id = '02a85c52d14c2183b386a6106dabb6621559d91518b1900bce49c36fc5abb42b'
AND (
token = 'GnOq1bgHGBlIkJo9TFyCrhel2m4rOQZPgOEVQCvV3+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)