UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BVcw1/ls9q55FmTYIQYiOkYesbd70ouyy5Y4BWYDuA4=' 
WHERE 
  key_id = 'e03c64932ecbc6bf0d407558007ab7ccc08cdade0fc7dc7469218de772ff7f52' 
  AND (
    token = 'BVcw1/ls9q55FmTYIQYiOkYesbd70ouyy5Y4BWYDuA4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018