UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '36yz/rFfPlwjm7+voKNr1InmHPx1yW9ZKK6ku7ssP9k=' 
WHERE 
  key_id = 'ced29fe86916f025b1ccb260097dcb794dacff8b8dbb0de48e37194e1d5e4038' 
  AND (
    token = '36yz/rFfPlwjm7+voKNr1InmHPx1yW9ZKK6ku7ssP9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035