UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UpkL99ujApRQABJhPB/znao281TkEZG6Rtca15Fddbo=' 
WHERE 
  key_id = 'a0cb41f6f8f9074c219efceeed405a27274bfc320f1539bda0ea8e5d0dd65552' 
  AND (
    token = 'UpkL99ujApRQABJhPB/znao281TkEZG6Rtca15Fddbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035