UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/vwOBf5vDDWm4mTB+Um+YJwtup20U/hmSXZUk0cBss=' 
WHERE 
  key_id = '1cb52f7d89b3c57ea05477f7d4f460b2303a052966189112e14d5dfe0eb86e73' 
  AND (
    token = 'U/vwOBf5vDDWm4mTB+Um+YJwtup20U/hmSXZUk0cBss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036