UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7evKxFyqyCILMh6m1X1hLbIG9rg79D2LS5upWFGph8c=' 
WHERE 
  key_id = '9c6f47911ff1e27dc7e5861da56a80447f4ad33d5ac57d193dfeabb196843bb4' 
  AND (
    token = '7evKxFyqyCILMh6m1X1hLbIG9rg79D2LS5upWFGph8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033