UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k+B2Wv4EeF8h6O8PHGsLWjlkfT/6cpGlTY1mx9cADq0=' 
WHERE 
  key_id = '8d63538236762b9f822dd856af06e9d8ba0db21f8b410699b25cabbbe452ad22' 
  AND (
    token = 'k+B2Wv4EeF8h6O8PHGsLWjlkfT/6cpGlTY1mx9cADq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037