UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N1QVmuBOnwBwCwnEUCQEMcxqVeGcKLzI8m88nOe4bN4=' 
WHERE 
  key_id = 'c0ad1b1bae82883abfcf7939710330ee403f7e94f9218380faaa5110164cf379' 
  AND (
    token = 'N1QVmuBOnwBwCwnEUCQEMcxqVeGcKLzI8m88nOe4bN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032