UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1vTOMkpuw/NGiKbV6VuTMHlNA4M8mrnugKmy0iSvOD4=' 
WHERE 
  key_id = '693464fda7856c04c6595475ff09e2033ed0f67ea1f0133f3c655c10cad741fc' 
  AND (
    token = '1vTOMkpuw/NGiKbV6VuTMHlNA4M8mrnugKmy0iSvOD4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043